package com.heima.controller;

import cn.hutool.captcha.CaptchaUtil;
import cn.hutool.captcha.ShearCaptcha;
import cn.hutool.core.util.RandomUtil;
import com.heima.pojo.dto.LoginDto;
import com.heima.pojo.vo.LoginUserVo;
import com.heima.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.awt.*;
import java.io.IOException;
import java.util.UUID;

@Slf4j
@RestController
@RequestMapping("/api/user-service/user")
public class LoginController {

    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public LoginUserVo login(@RequestBody LoginDto dto) {
        log.info("登录信息：{}", dto);
        return userService.login(dto);
    }

    @GetMapping("/imageCode/{clientToken}")
    public String image() {
        return null;
    }
}
